<template>
  <div id="param-info" v-if="Object.keys(paramInfo).length !== 0">
    <table
      v-for="(table, index) in paramInfo.sizes"
      :key="index"
      class="info-size"
    >
      <tr v-for="(tr, indey) in table" :key="indey">
        <td v-for="(td, indez) in tr" :key="indez">{{ td }}</td>
      </tr>
    </table>
    <table class="info-param">
      <tr v-for="(info, index) in paramInfo.infos" :key="index">
        <td class="info-param-key">{{ info.key }}</td>
        <td class="param-value">{{ info.value }}</td>
      </tr>
    </table>
    <div class="info-img" v-if="paramInfo.image.length !== 0">
      <img :src="paramInfo.image" alt="" />
    </div>
  </div>
</template>

<script>
export default {
  props: {
    paramInfo: {
      type: Object,
    },
  },
};
</script>

<style lang="less" scoped>
#param-info {
  border-top: 20px solid #f1f3f4;
  padding: 20px 10px;
  .info-size,
  .info-param {
    tr {
      display: block;
      height: 40px;
      line-height: 38px;
      border-bottom: 2px solid #f1f3f4;
      td {
        text-align: left;
        width: 76px;
      }
      .info-param-key {
        width: 80px;
      }
      .param-value {
        width: calc(100% - 80px);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        color: #ff5777;
      }
    }
  }
  .info-img {
    img {
      width: 100%;
    }
  }
}
</style>